/*    */ package com.zimbra.cs.service.account;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AccountConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.service.formatter.ContactCSV;
/*    */ import com.zimbra.soap.DocumentHandler;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetAvailableCsvFormats
/*    */   extends DocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 32 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 33 */     Account account = getRequestedAccount(zsc);
/*    */     
/* 35 */     if (!canAccessAccount(zsc, account)) {
/* 36 */       throw ServiceException.PERM_DENIED("can not access account");
/*    */     }
/* 38 */     Element response = zsc.createElement(AccountConstants.GET_AVAILABLE_CSV_FORMATS_RESPONSE);
/* 39 */     for (String format : ContactCSV.getAllFormatNames())
/* 40 */       response.addElement("csv").addAttribute("name", format);
/* 41 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/account/GetAvailableCsvFormats.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */